rename var1 id
rename var2 user_id
rename var3 qn
rename var4 qid
rename var5 order
rename var6 bid
rename var7 t_load
rename var8 t_submit
rename var9 chosen_act
rename var10 true_state
tab chosen_act true_state
gen correct=0
replace correct=1 if (true_state==4&chosen_act==6)|(true_state==10&chosen_act==8)
gen response=0
replace response=1 if chosen_act==6





gen state_2_DP_7=0
replace state_2_DP_7=1 if true_state==10 & qid==1
gen state_1_DP_8=0
replace state_1_DP_8=1 if true_state==4 & qid==5
gen state_2_DP_8=0
replace state_2_DP_8=1 if true_state==10 & qid==5
gen state_1_DP_9=0
replace state_1_DP_9=1 if true_state==4 & qid==6
gen state_2_DP_9=0
replace state_2_DP_9=1 if true_state==10 & qid==6

gen state_1_DP_10=0
replace state_1_DP_10=1 if true_state==4 & qid==7
gen state_2_DP_10=0
replace state_2_DP_10=1 if true_state==10 & qid==7

reg response state_2_DP_7 state_1_DP_8 state_2_DP_8 state_1_DP_9 state_2_DP_9 state_1_DP_10 state_2_DP_10, cluster(user_id)


logit response state_2_DP_7 state_1_DP_8 state_2_DP_8 state_1_DP_9 state_2_DP_9 state_1_DP_10 state_2_DP_10, cluster(user_id)
